'\" te
.\"  Copyright 1989 AT&T Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH REMOVEF 8 "Oct 30, 2007"
.SH NAME
removef \- remove a file from software database
.SH SYNOPSIS
.LP
.nf
\fBremovef\fR [ [\fB-M\fR] \fB-R\fR \fIroot_path\fR] [\fB-V\fR \fIfs_file\fR] \fIpkginst\fR \fIpath\fR...
.fi

.LP
.nf
\fBremovef\fR [ [\fB-M\fR] \fB-R\fR \fIroot_path\fR] [\fB-V\fR \fIfs_file\fR] \fB-f\fR \fIpkginst\fR
.fi

.SH DESCRIPTION
.sp
.LP
\fBremovef\fR informs the system that the user, or software, intends to remove
a pathname. Output from \fBremovef\fR is the list of input pathnames that may
be safely removed (no other packages have a dependency on them).
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.sp .6
.RS 4n
After all files have been processed, \fBremovef\fR should be invoked with the
\fB-f\fR option to indicate that the removal phase is complete.
.RE

.sp
.ne 2
.na
\fB\fB-M\fR\fR
.ad
.sp .6
.RS 4n
Instruct \fBremovef\fR not to use the \fB$\fR\fIroot_path\fR\fB/etc/vfstab\fR
file for determining the client's mount points. This option assumes the mount
points are correct on the server and it behaves consistently with Solaris 2.5
and earlier releases.
.RE

.sp
.ne 2
.na
\fB\fB\fR\fB-R\fR \fIroot_path\fR\fR
.ad
.sp .6
.RS 4n
Define the full path name of a directory to use as the \fIroot_path\fR. All
files, including package system information files, are relocated to a directory
tree starting in the specified \fIroot_path\fR. The \fIroot_path\fR may be
specified when installing to a client from a server (for example,
\fB/export/root/client1\fR).
.sp
\fBremovef\fR inherits the value of the \fBPKG_INSTALL_ROOT\fR environment
variable. (See ENVIRONMENT VARIABLES, below.) If \fBPKG_INSTALL_ROOT\fR is set,
such as when the \fB-R\fR option is used with \fBpkgadd\fR(8) or
\fBpkgrm\fR(8), there is no need to use the \fBremovef\fR \fB-R\fR option.
.LP
Note -
.sp
.RS 2
The root file system of any non-global zones must not be referenced with the
\fB-R\fR option. Doing so might damage the global zone's file system, might
compromise the security of the global zone, and might damage the non-global
zone's file system. See \fBzones\fR(7).
.RE
.RE

.sp
.ne 2
.na
\fB\fB-V\fR \fIfs_file\fR\fR
.ad
.sp .6
.RS 4n
Specify an alternative \fIfs_file\fR to map the client's file systems. For
example, used in situations where the \fB$\fR\fIroot_path\fR\fB/etc/vfstab\fR
file is non-existent or unreliable.
.RE

.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIpath\fR\fR
.ad
.sp .6
.RS 4n
The pathname to be removed.
.RE

.sp
.ne 2
.na
\fB\fIpkginst\fR\fR
.ad
.sp .6
.RS 4n
The package instance from which the pathname is being removed.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRUsing \fBremovef\fR
.sp
.LP
The following example uses the \fBremovef\fR command in an optional pre-install
script:

.sp
.in +2
.nf
echo "The following files are no longer part of this package
      and are being removed."
removef $PKGINST /myapp/file1 /myapp/file2 |
while read pathname
do
     echo "$pathname"
     rm \fB-f\fR $pathname
done
removef \fB-f\fR $PKGINST || exit 2
.fi
.in -2
.sp

.SH ENVIRONMENT VARIABLES
.sp
.LP
\fBremovef\fR inherits the value of the following environment variable. This
variable is set when \fBpkgadd\fR(8) or \fBpkgrm\fR(8) is invoked with the
\fB-R\fR option.
.sp
.ne 2
.na
\fB\fBPKG_INSTALL_ROOT\fR\fR
.ad
.sp .6
.RS 4n
If present, defines the full path name of a directory to use as the system's
\fBPKG_INSTALL_ROOT\fR path. All product and package information files are then
looked for in the directory tree, starting with the specified
\fBPKG_INSTALL_ROOT\fR path. If not present, the default system path of \fB/\fR
is used.
.RE

.SH EXIT STATUS
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.sp .6
.RS 4n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.sp .6
.RS 4n
An error occurred.
.RE

.SH SEE ALSO
.sp
.LP
.BR pkginfo (1),
.BR pkgmk (1),
.BR pkgparam (1),
.BR pkgproto (1),
.BR pkgtrans (1),
.BR attributes (7),
.BR largefile (7),
.BR installf (8),
.BR pkgadd (8),
.BR pkgask (8),
.BR pkgchk (8),
.BR pkgrm (8)
.sp
.LP
\fI\fR
.SH NOTES
.sp
.LP
Package commands are \fBlargefile\fR(7)-aware. They handle files larger than 2
GB in the same way they handle smaller files. In their current implementations,
\fBpkgadd\fR(8), \fBpkgtrans\fR(1) and other package commands can process a
datastream of  up to 4 GB.
